using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class Supports
	{
        private int _RowNum;

        public int RowNum
        {
            get { return _RowNum; }
            set { _RowNum = value; }
        }

		private int _ID;

		public int ID
		{
			get { return _ID; }
			set { _ID = value; }
		}

		private string _Yahoo;

		public string Yahoo
		{
			get { return _Yahoo; }
			set { _Yahoo = value; }
		}

		private string _Fullname;

		public string Fullname
		{
			get { return _Fullname; }
			set { _Fullname = value; }
		}

		public Supports()
		{ }

		public Supports(int ID,string Yahoo,string Fullname)
		{
			this.ID = ID;
			this.Yahoo = Yahoo;
			this.Fullname = Fullname;
		}

		public override string ToString()
		{
			return "ID = " + ID.ToString() + ",Yahoo = " + Yahoo + ",Fullname = " + Fullname;
		}

		public class IDComparer : System.Collections.Generic.IComparer<Supports>
		{
			public SorterMode SorterMode;
			public IDComparer()
			{ }
			public IDComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Supports> Membres
			int System.Collections.Generic.IComparer<Supports>.Compare(Supports x, Supports y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.ID.CompareTo(x.ID);
				}
				else
				{
					return x.ID.CompareTo(y.ID);
				}
			}
			#endregion
		}
		public class YahooComparer : System.Collections.Generic.IComparer<Supports>
		{
			public SorterMode SorterMode;
			public YahooComparer()
			{ }
			public YahooComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Supports> Membres
			int System.Collections.Generic.IComparer<Supports>.Compare(Supports x, Supports y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Yahoo.CompareTo(x.Yahoo);
				}
				else
				{
					return x.Yahoo.CompareTo(y.Yahoo);
				}
			}
			#endregion
		}
		public class FullnameComparer : System.Collections.Generic.IComparer<Supports>
		{
			public SorterMode SorterMode;
			public FullnameComparer()
			{ }
			public FullnameComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Supports> Membres
			int System.Collections.Generic.IComparer<Supports>.Compare(Supports x, Supports y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Fullname.CompareTo(x.Fullname);
				}
				else
				{
					return x.Fullname.CompareTo(y.Fullname);
				}
			}
			#endregion
		}
	}
}
